<template>
  <div>
    <div>
      <div class="newshead">
        <div class="title-head" title="专家库">专家库</div>
      </div>
    </div>
    <div class="expert-area">
      <div class="item" v-for="(item,index) in expertList" :key="index">
        <el-image fit="cover" class="image" :src="item.imgUrl"></el-image>
        <div class="desc">
          <h1><em>姓名：</em>{{item.name}}</h1>
          <h1>职称：{{item.job}}</h1>
          <h1>从事领域：{{item.work}}</h1>
        </div>
      </div>
    </div>
    <van-pagination @change='nextpage' v-model="currentPage" :total-items="total" :show-page-size="10" force-ellipses />
    <div class="footer">
      <div class="aboutme">
      </div>
      <van-divider />
      <div class="last">
        <a href="http://www.beian.miit.gov.cn">
          备案号：苏ICP备20041612号
        </a>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'PhoneExpert',
  data () {
    return {
      expertList: [],
      total: 0,
      currentPage: 1
    }
  },
  methods: {
    getExpert () {
      this.$axios({
        method: 'get',
        url: '/expert/select?page=1&pageSize=10'
      }).then((res) => {
        this.expertList = res.data.data.rows
        this.total = res.data.data.records
      })
    },
    nextpage (e) {
      this.$axios({
        method: 'get',
        url: '/expert/select?page=' + e + '&pageSize=10'
      }).then((res) => {
        if (res.status === 200) {
          this.expertList = res.data.data.rows
          this.total = res.data.data.records
        }
      })
    }
  },
  mounted () {
    this.getExpert()
  }
}
</script>

<style scoped>
.expert-area {
  width: 100%;
  background: white;
  overflow: hidden;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  align-items: center;
  min-height: 510px;
}
.item {
  height: 160px;
  position: relative;
  margin: 15px 10px;
  border: #cccccc 1px solid;
  border-radius: 5px;
}
.image {
  width: 90px;
  height: 120px;
  float: left;
  margin: 15px 10px 10px 10px;
}
.desc {
  margin: 10px 10px 10px 105px;
  height: 120px;
  line-height: 25px;
  font-size: 16px;
}
.newshead {
  width: 300px;
  height: 60px;
  background: rgb(15, 66, 155);
  color: white;
  font-size: 25px;
  text-align: center;
  overflow: hidden;
  margin: 15px auto;
  border-radius: 5px;
}
.title-head {
  line-height: 40px;
  margin: 10px 0;
  cursor: pointer;
}
.footer {
  text-align: center;
  background: #364a62;
  margin-bottom: 60px;
  overflow: hidden;
  margin-top: 15px;
}
.aboutme {
  margin-top: 10px;
  color: white;
  font-weight: 600;
}
.content {
  margin-top: 10px;
  text-align: center;
  font-weight: normal;
}
.last {
  height: 20px;
  line-height: 20px;
  color: white;
  margin-bottom: 16px;
}
a {
  text-decoration: none;
  color: white;
}
</style>
